from elasticsearch import Elasticsearch
from args import *

def delete():
    es = Elasticsearch(hosts=ELASTIC_ADDRESS, basic_auth=(ELASTIC_USERNAME, ELASTIC_PASSWORD), timeout=1000)
    index = INDEX_NAME
    if es.indices.exists(index=index):
        temp = es.indices.delete(index=index, timeout="100s")
        print(temp)
    else:
        print("该索引不存在")

if __name__ == "__main__":
    delete()